package zouran.shounewsspringboot.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import zouran.shounewsspringboot.entity.ResultMap;
import zouran.shounewsspringboot.service.LinkService;

/**
 * @author zouran
 * createDate：2023/6/3  19:03
 */
@CrossOrigin
@RestController
@RequestMapping("/link")
public class LinkController {
    private final LinkService linkService;
    private final ResultMap<Object> resultMap;

    public LinkController(LinkService linkService, ResultMap<Object> resultMap) {
        this.linkService = linkService;
        this.resultMap = resultMap;
    }

    /**
     * @return 全部链接
     */
    @RequestMapping("/getAllLink")
    public ResultMap<Object> getAllLink() {
        return resultMap.success(linkService.getAllLink());
    }
}
